:header
call %working_dir%\header.cmd

REM 5-Additions.bat
ECHO This will copy various files and folders into your PE image.  
ECHO They will be loaded to the X:\ drive (the RAM drive) 
ECHO instead of the drive letter of the CD itself.
ECHO Don't try to load too much into the RAM drive
ECHO you'll end up needing a ton of RAM just to
ECHO use your PE disc, kinda defeating the purpose...
ECHO.

:WAIK
REM Change DIR to Windows AIK
cd "%waik%\PETools\

:Main Menu
ECHO -------------------------------------
ECHO          Additions Menu
ECHO -------------------------------------
ECHO.
ECHO 1. Add Programs
ECHO Q. Quit to Main Menu
ECHO.
ECHO.

REM ========== Choice Logic ============
choice /c:1q /n /m "%choice_text%"
if errorlevel 2 goto :end
if errorlevel 1 goto :start

:start
ECHO.
set additions_source=%working_dir%WinPE

:copy

REM echo Example of copying the contents of a "Tools" folder to the PE RAM drive
REM echo They will be accessible in the PE environment under X:\Tools.
REM md "%mountpath%\Tools"
REM xcopy "%additions_source%\Tools\*.*" "%mountpath%\Tools\*.*" /e /y

echo.
echo Example of copying items to the PE RAM disk's Windows\System32 folder.
echo These items will be accessible from X:\Windows\System32.
ECHO.
ECHO copying files from "%additions_source% %arch-type%\ to %mountpath%\Windows\System32
ECHO.
xcopy "%additions_source% %arch-type%\*.*" "%mountpath%\Windows\System32\*.*" /E /Y
DEL "%mountpath%\windows\system32\winpe.bmp"
Move "%mountpath%\windows\system32\winpe1.bmp" "%mountpath%\windows\system32\winpe.bmp"

echo The appropriate files have been copied.
ECHO.
ECHO Check for copy errors
pause > nul

:end
call %working_dir%\end.cmd